/**
 * Created with IntelliJ IDEA.
 * User: happyiu
 * Date: 2022-02-28
 * Time: 21:38
 * Description:
 */

/*class MyArrayList{
    private int[] elem;
    private int useSize;
    public MyArrayList(){
        this.elem = new int[10];
    }
    public void add(int val){
        this.elem[useSize] = val;
        useSize++;
    }
    public int get(int pos){
        return this.elem[pos];
    }
}*/

class MyArrayList{
    private Object[] elem;
    private int useSize;
    public MyArrayList(){
        this.elem = new Object[10];
    }
    public void add(Object val){
        this.elem[useSize] = val;
        useSize++;
    }
    public Object get(int pos){
        return this.elem[pos];
    }
}

public class TestDemo {
    public static void main1(String[] args) {
        MyArrayList myArrayList = new MyArrayList();
        myArrayList.add(10);
        myArrayList.add("kkk");
    }

    public static void main(String[] args) {
        MyArrayList myArrayList = new MyArrayList();
        myArrayList.add(10);
        myArrayList.add("kkk");
        String ret = myArrayList.get(1);
    }


}
